<?php 
$categoria_padre=null;
$this->headScript()
        ->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.core.js")
        ->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.widget.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.datepicker.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/i18n/jquery.ui.datepicker-es.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.position.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.mouse.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.draggable.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.droppable.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.resizable.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.dialog.js")
		->appendFile($this->baseUrl()."/js/jquery/development-bundle/ui/jquery.ui.button.js")
		->appendFile($this->baseUrl()."/js/functions/admin-functions.js");

$this->headLink()->appendStylesheet($this->baseUrl(). '/js/jquery/development-bundle/themes/base/jquery.ui.all.css');
$this->headTitle('Nuevo producto destacado');

?>
<script type="text/javascript">
	jQuery(function() {
		jQuery( "#canceladd, #addfeatured" ).button();
		jQuery.datepicker.setDefaults( jQuery.datepicker.regional["es"] );
		
	});
	$(function() {
		var dates = $( "#Start, #End" ).datepicker({
			dateFormat: 'yy-mm-dd',
			changeMonth: true,
			numberOfMonths: 1,
			minDate: "<?php echo date("Y-m-d");?>",
			maxDate: "+5M +10D",
			onSelect: function( selectedDate ) {
				var option = this.id == "Start" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" ),
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates.not( this ).datepicker( "option", option, date );
			}
		});
	});
</script>


<div class="section">
<div class="section_inner">
<p class="errorText">&nbsp;<?php echo $this->messageError; ?></p>
<div class="title_wrapper">
	<h2>Agregar producto destacado</h2>
</div>
<div class="section_content">
<form method="POST" action="<?php echo $this->baseUrl();?>/admin/products/addfeatured/" name="add">
	<table cellspacing="0" cellpadding="2" border="0">
          <tbody><tr>
            <td class="main">Product:&nbsp;</td>
            <td class="main">
            	<select style="font-size:12px; width: 400px" size="15" name="products_id">
<?php 
if(!empty($this->Products)){
	foreach($this->Products as $prod){
		$newprice=$prod['Price'];
		
		if(!empty($prod['TaxPercent']) && $prod['TaxPercent'] > 0){
			$newprice = $prod['Price'] * (($prod['TaxPercent'] / 100) + 1);
		}
		
		?>
					<option value="<?php echo $prod['Id'];?>"><?php echo $prod['Name'];?> ($<?php echo (sprintf("%01.2f", $newprice)); ?>) [<?php echo $prod['Category'];?>]  - ID# <?php echo $prod['Id'];?></option>
<?php 		
	}
}
?>	            	
	            </select>
            </td>
          </tr>
          <tr>
            <td class="main">Fecha disponible:&nbsp;</td>
            <td class="main"><input type="text" value="" size="12" name="Start" id="Start" class="cal-TextBox"></td>
          </tr>
          <tr>
            <td class="main">Fecha de expiración:&nbsp;</td>
            <td class="main"><input type="text" value="" name="End" id="End" size="12" class="so-BtnLink"></td>
          </tr>
          <tr>
          	<td class="main">&nbsp;</td>
          	<td  class="main">
          		<a href="<?php echo $this->baseUrl();?>/admin/products/featuredlist/" id="canceladd">Cancelar</a>
						<input type="submit" id="addfeatured" name="agregar"  value="guardar" />
          	</td>
          </tr>
        </tbody>
        
	</table>
</form>


</div>
</div>
</div>


    